import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/components/Home'
//客户相关模板开始--程凡
import CustomerInfoManagement from '@/components/CustomerInfoManagement'
import Client from '@/components/Client'
import Associate from '@/components/Associate'
//客户相关模板结束--程凡
import ServiceCreate from "@/components/ServiceCreate.vue"
import ServiceManagement from "@/components/ServiceManagement.vue"

//客户流失管理
import CustomerLost from '@/components/CustomerLost'
import ConfirmLost from '@/components/ConfirmLost'
import DeferLost from '@/components/DeferLost'
//客户流失管理


import CustomerDevelopmentPlan1 from '@/components/CustomerDevelopmentPlan1'
import CustomerDevelopmentPlan from '@/components/CustomerDevelopmentPlan'
import Users from '@/components/Users'
import Roles from '@/components/Roles'
import Pers from '@/components/Pers'
import UpdPassword from '@/components/UpdPassword'
import AnalysisConstruct from '@/components/AnalysisConstruct'
import AnalysisServe from '@/components/AnalysisServe'
import AnalysisLose from '@/components/AnalysisLose'



import Sale from '@/components/Sale'
Vue.use(Router)
export default new Router({

  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/Home',
      name: 'Home',
      component: Home,
      meta: {
        requireAuth: true, //表示，这个组件需要登录
      },
      children:[
        //服务管理开始
        {
         path:"/ServiceCreate",
          name:"ServiceCreate",
          component: ServiceCreate,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        {
          path:"/ServiceManagement",
          name:"ServiceManagement",
          component: ServiceManagement ,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        {
          path:"/ServiceManagement/:svr_id",
          name:"ServiceManagement",
          component: ServiceManagement ,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },

        //服务管理结束
      
      
        //客户流失管理start
        {
          path: '/CustomerLost',
          name: 'CustomerLost',
          component:CustomerLost,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        {
          path: '/ConfirmLost',
          name: 'ConfirmLost',
          component:ConfirmLost,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        {
          path: '/DeferLost',
          name: 'DeferLost',
          component:DeferLost,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },

      
      //客户流失管理end
        
        //客户管理--程凡
        {
          path: '/CustomerInfoManagement',
          name: 'CustomerInfoManagement',
          component: CustomerInfoManagement,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        //联系人界面--程凡
        {
          path:'/Client/:id',
          name:'Client',
          component:Client,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        //交往记录界面--程凡
        {
          path:'/Associate/:id',
          name:'Associate',
          component:Associate,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        {

          path: '/CustomerDevelopmentPlan1',
          name: 'CustomerDevelopmentPlan1',
          component: CustomerDevelopmentPlan1,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },

        //用户管理
        {
          path: '/Users',
          name: 'Users',
          component: Users,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },

        //角色管理
        {
          path: '/Roles',
          name: 'Roles',
          component: Roles,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },

        //权限管理
        {
          path: '/Pers',
          name: 'Pers',
          component: Pers,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },

        },
        //修改密码
        {
          path: '/UpdPassword',
          name: 'UpdPassword',
          component: UpdPassword,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },

        },

        //客户构成分析
        {
          path: '/AnalysisConstruct',
          name: 'AnalysisConstruct',
          component: AnalysisConstruct,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },

        },
        //客户服务分析
        {
          path: '/AnalysisServe',
          name: 'AnalysisServe',
          component: AnalysisServe,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },

        },
        //客户流失分析
        {
          path: '/AnalysisLose',
          name: 'AnalysisLose',
          component: AnalysisLose,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },

        },




        {
          path: '/CustomerDevelopmentPlan/:sale_id',
          name: 'CustomerDevelopmentPlan',
          component: CustomerDevelopmentPlan,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },
        //销售机会管理
        {
          path: '/Sale',
          name: 'Sale',
          component: Sale,
          meta: {
            requireAuth: true, //表示，这个组件需要登录
          },
        },

      ]

    }
  ]
})
